let express = require('express');
let path = require('path');
let logger = require('morgan');
let adminRouter = require('./routes/admin');
let webRouter = require('./routes/web/user.js');
let msgRouter = require('./routes/web/message');
let app = express();

app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
//设置静态文件的存储位置
app.use('/uploads', express.static(__dirname + '/uploads'));

adminRouter(app);
webRouter(app);
msgRouter(app);
app.listen(22222,()=>{
  console.log("http://localhost:22222");
})
module.exports = app;
